#include "FileInfoBox.h"

FileInfoBox::FileInfoBox(const QString &text, QWidget *parent) : QWidget(parent)
{
	mainLayout = new QHBoxLayout(this);
	checkBox = new QCheckBox(this);
	pathChoiceBox = new FilePathChoiceBox(this);
	filenameBox = new FormatFilenameBox(this);
	label = new QLabel(text, this);

	mainLayout -> addWidget(checkBox);
	mainLayout -> addWidget(label);
	mainLayout -> addWidget(pathChoiceBox);
	mainLayout -> addWidget(filenameBox);
	mainLayout -> setAlignment(Qt::AlignmentFlag::AlignCenter);

	setLayout(mainLayout);

	label -> setFixedWidth(65);

	checkBox -> setContentsMargins(0, 0, 0, 0);
	pathChoiceBox -> setContentsMargins(0, 0, 0, 0);
	filenameBox -> setContentsMargins(0, 0, 0, 0);
	label -> setContentsMargins(0, 0, 0, 0);
	setContentsMargins(0, 0, 0, 0);
	mainLayout -> setAlignment(Qt::AlignmentFlag::AlignCenter);
}

FileInfoBox::~FileInfoBox()
{
	delete mainLayout;
	delete checkBox;
	delete pathChoiceBox;
	delete filenameBox;
	delete label;
}
